package com.autosalon.model;

import java.io.Serializable;
import java.sql.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "PUJCKA")
public class Pujcka implements Serializable, IModelClass{

	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private Long id;
	
	@Column(name="MESICNI_SPLATKA", nullable = false)
	private int mesicniSplatka;
	
	@Column(name = "POC_DATUM", nullable = false)
	private Date pocDatum;
	
	@Column(name = "KON_DATUM", nullable = false)
	private Date konDatum;
	
	@ManyToOne(cascade = {CascadeType.PERSIST,CascadeType.MERGE,CascadeType.REFRESH})
	@JoinColumn(name = "ID_BANKY")
	private Banka banka;
	


	@Override
	public Long getId() {
		return id;
	}
	
	public void setId(Long id) {
		this.id = id;
	}

	public int getMesicniSplatka() {
		return mesicniSplatka;
	}

	public void setMesicniSplatka(int mesicniSplatka) {
		this.mesicniSplatka = mesicniSplatka;
	}

	public Date getPocDatum() {
		return pocDatum;
	}

	public void setPocDatum(Date pocDatum) {
		this.pocDatum = pocDatum;
	}

	public Date getKonDatum() {
		return konDatum;
	}

	public void setKonDatum(Date konDatum) {
		this.konDatum = konDatum;
	}

	public Banka getBanka() {
		return banka;
	}

	public void setBanka(Banka banka) {
		this.banka = banka;
	}


	
	
}
